<template>
  <a-select
    v-model:value="value"
    show-search
    placeholder="请选择,中英文"
    :options="OPTIONS"
    style="width: 100%"
    :filter-option="filterOption"
  ></a-select>
</template>
<script lang="ts" setup>
import Api from "@/api/backend/api";    
const value = defineModel({ type: String })

let OPTIONS = ref([]);
onMounted(async () => {
  OPTIONS.value = await Api.unitController.option();
});
const selectedItems = ref<string[]>([]);

const filterOption = (input: string, option: any) => {
  return (
    option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0 ||
    option.pinyin.toLowerCase().indexOf(input.toLowerCase()) >= 0
  );
};
</script>
